package com.far.permissions.interceptor;

import com.far.permisions.context.DpContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class Controller {
    @Resource
    private CatMapper catMapper;

    @GetMapping("/test")
    public void test() {
        DpContext dpContext = DpContext.register();
        Cat cat = catMapper.selectOne("Billie", "綠色");
        System.out.println();
    }

    @GetMapping("/test2")
    public void test2() {
        catMapper.updateOne("Billie", "1");
        System.out.println();
    }

    @GetMapping("/test3")
    public void test3() {
        catMapper.delete("100");
        System.out.println();
    }
}
